
package org.jeecg.modules.flowable.utils.flow;

import org.flowable.bpmn.model.ExtensionElement;
import org.flowable.bpmn.model.FlowElement;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * 获取流程实例拓展参数
 */
public class ExtensionElementUtil {

    public static String elementText(String key, FlowElement element) {
        List<ExtensionElement> list = element.getExtensionElements().get(key);
        if (CollectionUtils.isEmpty(list)) {
            return null;
        }
        return list.get(0).getElementText();
    }

}
